/*******************************************************************************
* 
* A simple logging infra
* 
* 
******************************************************************************/
#pragma once
#include "logger.h"

namespace noria{ namespace diagnostic
{

#if (NLOG || _DEBUG)
    // http://stackoverflow.com/questions/679979/how-to-make-a-variadic-macro-variable-number-of-arguments
#define LOG_DEBUG(msg, ...) Logger_::instance()->write(LogLevel::DEBUG_, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define LOG_INFO(msg, ...) Logger_::instance()->write(LogLevel::INFO, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define LOG_WARN(msg, ...) Logger_::instance()->write(LogLevel::WARN, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define LOG_ERROR(msg, ...) Logger_::instance()->write(LogLevel::ERROR_, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define LOG_FATAL(msg, ...) Logger_::instance()->write(LogLevel::FATAL, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#else // DEBUG_
#define LOG_DEBUG(...)
#define LOG_INFO(...)
#define LOG_WARN(...)
#define LOG_ERROR(...)
#define LOG_FATAL(...)
#endif // DEBUG_

}}